﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace JWXH.XH.pages
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class AbsoluteTest : ContentPage
    {
        public AbsoluteTest()
        {
            InitializeComponent();
            Loading_OnTap(null, null);
        }

        private double totalSeconds = 5;
        private double currSeconds = 0;
        public void Loading_OnTap(object sender, EventArgs e)
        {
         
            Device.StartTimer(TimeSpan.FromSeconds(1), () =>
            {
                currSeconds++;
                var ret = totalSeconds > currSeconds;

                // 
                if (!ret)
                {
                    this.Loading.IsRunning = false;
                }
                return ret;
            });
        }
    }
}